package com.woniu.liuzhougov.relatedinformation.service.impl;

import com.woniu.liuzhougov.relatedinformation.dao.GoodEnterpriseMapper;
import com.woniu.liuzhougov.relatedinformation.pojo.GoodEnterprise;
import com.woniu.liuzhougov.relatedinformation.service.RelatedInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Description: desc
 * @author: Chris
 * @createDate: 2019/4/23 0023
 * @version: 1.0
 */
@Service("goodEnterpriseService")
public class GoodEnterpriseServiceImpl implements RelatedInformationService<GoodEnterprise> {

    @Autowired
    private GoodEnterpriseMapper goodEnterpriseMapper;

    @Override
    public List<GoodEnterprise> selectList() {
        return goodEnterpriseMapper.selectGoodEnterpriseList();
    }

    @Override
    public List<GoodEnterprise> selectByName(String enterpriseName) {
        return goodEnterpriseMapper.selectGoodEnterpriseByName(enterpriseName);
    }

    @Override
    @Transactional
    public int deleteById(Integer id) {
        return goodEnterpriseMapper.deleteByPrimaryKey(id);
    }

    @Override
    @Transactional
    public int insert(GoodEnterprise goodEnterprise) {
        return goodEnterpriseMapper.insert(goodEnterprise);
    }

    @Override
    @Transactional
    public int update(GoodEnterprise goodEnterprise) {
        return goodEnterpriseMapper.updateByPrimaryKey(goodEnterprise);
    }

    @Override
    public GoodEnterprise selectById(Integer id) {
        return goodEnterpriseMapper.selectByPrimaryKey(id);
    }

}
